/*
 * Copyright 2009 Original Author(s)
 * 
 * This file is part of Kommando
 * 
 * Kommando is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Kommando is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Kommando.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.kommando.core.catalog;

import javax.swing.Icon;
import javax.swing.ImageIcon;

import org.kommando.core.action.AbstractAction;

/**
 * @author Peter De Bruycker
 */
public class SimpleCatalogObject extends AbstractCatalogObject {

    // TODO attribute: icon taken from http://statik-04.deviantart.com/art/Tango-Defraggler-Icon-101442350
    private static final Icon DEFAULT_ICON = new ImageIcon(AbstractAction.class.getResource("/icons/object.png"));

    private String id;
    private String name;
    private String description;
    private Icon icon;

    public SimpleCatalogObject(String id, String name, String description) {
        this(id, name, description, null);
    }

    public SimpleCatalogObject(String id, String name, String description, Icon icon) {
        this.id = id;
        this.name = name;
        this.description = description;

        this.icon = icon == null ? DEFAULT_ICON : icon;
    }

    @Override
    public String getDescription() {
        return description;
    }

    @Override
    public Icon getIcon() {
        return icon;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public String getId() {
        return id;
    }

    @Override
    public String toString() {
        return "SimpleCatalogObject[id=" + id + ", name=" + name + ", description=" + description + "]";
    }
}
